From: Jasper St. Pierre Date: Fri, 11 Jan 2013 19:05:17 +0000 (-0500) Subject: loginDialog: Allow right-clicking on button items X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5039 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a0d7d7bc4b2cec15273a5e3f41914d8651dbb270;p=gnome-shell.git loginDialog: Allow right-clicking on button items In a gdm session, we may not know what mouse orientation the user may be in, so it makes sense to support both the left and right mouse buttons to activate login or other items. Additionally, add the behavior to all modal dialog items, even in a user session, because it's unlikely that the user will right-click on buttons, and it makes for an easier implementation. https://bugzilla.gnome.org/show_bug.cgi?id=688748 --- diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 6bdd9af93..31c04ebaf 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -128,6 +128,7 @@ const UserListItem = new Lang.Class({ let layout = new St.BoxLayout({ vertical: false }); this.actor = new St.Button({ style_class: 'login-dialog-user-list-item', + button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, can_focus: true, child: layout, reactive: true, @@ -492,6 +493,7 @@ const SessionListItem = new Lang.Class({ this.id = id; this.actor = new St.Button({ style_class: 'login-dialog-session-list-item', + button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, can_focus: true, reactive: true, x_fill: true, @@ -552,6 +554,7 @@ const SessionList = new Lang.Class({ this.actor.child = this._box; this._button = new St.Button({ style_class: 'login-dialog-session-list-button', + button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, can_focus: true, x_fill: true, y_fill: true }); @@ -787,6 +790,7 @@ const LoginDialog = new Lang.Class({ let notListedLabel = new St.Label({ text: _("Not listed?"), style_class: 'login-dialog-not-listed-label' }); this._notListedButton = new St.Button({ style_class: 'login-dialog-not-listed-button', + button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, can_focus: true, child: notListedLabel, reactive: true, diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index ac74afdd9..78e36dcf3 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -157,6 +157,7 @@ const ModalDialog = new Lang.Class({ keys = []; let button = new St.Button({ style_class: 'modal-dialog-button', + button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, reactive: true, can_focus: true, label: label });